﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace AdminSystem.EntityFrameworkCore.Migrations
{
    public partial class dpy : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Citys",
                columns: table => new
                {
                    CityId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    CityName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    ProvinceId = table.Column<int>(type: "int", nullable: false),
                    InsertName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InsertData = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeleteName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeleteData = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateData = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDelete = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Citys", x => x.CityId);
                });

            migrationBuilder.CreateTable(
                name: "HealthCares",
                columns: table => new
                {
                    HealthCareId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    TraceabilityId = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    FeedingDays = table.Column<int>(type: "int", nullable: false),
                    HealthCareManner = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    HealthCareMethod = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    InsertName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InsertData = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeleteName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeleteData = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateData = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDelete = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_HealthCares", x => x.HealthCareId);
                });

            migrationBuilder.CreateTable(
                name: "Processings",
                columns: table => new
                {
                    ProcessingId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    TraceabilityId = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    FirmName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    ProducePermit = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    FoodSafetyPic = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    InsertName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InsertData = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeleteName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeleteData = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateData = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDelete = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Processings", x => x.ProcessingId);
                });

            migrationBuilder.CreateTable(
                name: "Provices",
                columns: table => new
                {
                    ProvinceId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ProviceName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    InsertName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InsertData = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeleteName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeleteData = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateData = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDelete = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Provices", x => x.ProvinceId);
                });

            migrationBuilder.CreateTable(
                name: "rawMaterials",
                columns: table => new
                {
                    RawMaterialId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    TraceabilityId = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    AccessoriesPic = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    RawMaterialPic = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    AdditivePic = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    PackagMaterialsPic = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    InsertName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InsertData = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeleteName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeleteData = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateData = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDelete = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_rawMaterials", x => x.RawMaterialId);
                });

            migrationBuilder.CreateTable(
                name: "roles",
                columns: table => new
                {
                    RoleId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RoleName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    InsertName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InsertData = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeleteName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeleteData = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateData = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDelete = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_roles", x => x.RoleId);
                });

            migrationBuilder.CreateTable(
                name: "shopps",
                columns: table => new
                {
                    ShoppId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ShoppName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    InsertName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InsertData = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeleteName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeleteData = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateData = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDelete = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_shopps", x => x.ShoppId);
                });

            migrationBuilder.CreateTable(
                name: "slaughters",
                columns: table => new
                {
                    SlaughterId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    TraceabilityId = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    Batch = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    PresentWeight = table.Column<int>(type: "int", nullable: false),
                    PresentData = table.Column<DateTime>(type: "datetime2", nullable: false),
                    SlaughterData = table.Column<DateTime>(type: "datetime2", nullable: false),
                    SlaughterPic = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    InsertName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InsertData = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeleteName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeleteData = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateData = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDelete = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_slaughters", x => x.SlaughterId);
                });

            migrationBuilder.CreateTable(
                name: "tracebilities",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    TraceabilityId = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    ShoppId = table.Column<int>(type: "int", nullable: false),
                    ProBatch = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    ShelfLife = table.Column<int>(type: "int", nullable: false),
                    ProLicense = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    Manufacturers = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    CoverPic = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: false),
                    IsDelete = table.Column<bool>(type: "bit", nullable: false),
                    InsertName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InsertData = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeleteName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeleteData = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateData = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_tracebilities", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "userInfos",
                columns: table => new
                {
                    UserId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    UserName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    UserPass = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    UserNickname = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    RoleId = table.Column<int>(type: "int", nullable: false),
                    InsertName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InsertData = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeleteName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeleteData = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateData = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDelete = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_userInfos", x => x.UserId);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Citys");

            migrationBuilder.DropTable(
                name: "HealthCares");

            migrationBuilder.DropTable(
                name: "Processings");

            migrationBuilder.DropTable(
                name: "Provices");

            migrationBuilder.DropTable(
                name: "rawMaterials");

            migrationBuilder.DropTable(
                name: "roles");

            migrationBuilder.DropTable(
                name: "shopps");

            migrationBuilder.DropTable(
                name: "slaughters");

            migrationBuilder.DropTable(
                name: "tracebilities");

            migrationBuilder.DropTable(
                name: "userInfos");
        }
    }
}
